package extrace.ui.main.ui;


import android.app.Activity;
import android.os.Bundle;
import android.view.Window;

import com.amap.api.maps2d.CameraUpdateFactory;
import com.amap.api.maps2d.MapView;
import com.amap.api.maps2d.model.MyLocationStyle;

import extrace.ui.main.R;

public class MapActivity extends Activity  {

    private MapView mapView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);// 不显示程序的标题栏
        setContentView(R.layout.activity_map);

        mapView = findViewById(R.id.map);
        mapView.onCreate(savedInstanceState);// 此方法必须重写
        mapView.getMap().setMyLocationEnabled(true);
        mapView.getMap().moveCamera(CameraUpdateFactory.zoomTo(18));
        mapView.getMap().setMyLocationStyle(
                new MyLocationStyle()
                        .interval(2000)
                        .myLocationType(MyLocationStyle.LOCATION_TYPE_FOLLOW)
        );
    }
}

